<template>
  <div class="nothingDetails">
    <div>
      <!-- <van-loading
        size="24px"
        v-show="mainStore.isLoading"
        @click="loadingClick"
        >加载中...</van-loading
      > -->
    </div>
    <div class="empty" v-if="list.length === 0">
      <van-empty description="暂无数据" />
    </div>
    <div class="noMore" v-if="list.length !== 0&&lastPage===page">
        数据加载完成
    </div>
  </div>
</template>
<script setup>
// 啥也不说了每一行代码都手敲好累
import { Loading } from "vant";
import { Empty } from "vant";
import useMainStore from "@/stores/modules/main";
import { toRefs, defineProps } from "vue";
const props = defineProps({
  //子组件接收父组件传递过来的值
  list: Array,
  lastPage: Number,
  page:Number
});
//使用父组件传递过来的值
const { list, lastPage } = toRefs(props);
const mainStore = useMainStore();
const loadingClick = () => {
  mainStore.isLoading = false;
};

//如果是子传父，波比记性差所以写下来，从头搭vue3真的好累
// const emit = defineEmits(['clickChild'])
// const clickChild=()=>{
//   let param={
//     content:'b'
//   }
//   //传递给父组件
//   emit('clickChild',param)

</script>
<style lang="scss" scoped>
.nothingDetails {
    margin-top: 10px;
  .empty {
  }
  .noMore {
    text-align: center;
    color: var(--van-gray-5);
  }
}
</style>